package com.sfjswl.fp.core.result;

import com.sfjswl.fp.core.context.RulePack;
import com.sfjswl.fp.core.context.RuleRoam;
import com.sfjswl.fp.core.leaf.pack.BaseLeafPackResult;
import lombok.Data;
import lombok.EqualsAndHashCode;

import javax.annotation.Resource;

@Data
@EqualsAndHashCode(callSuper = true)
public class AmountResult2 extends BaseLeafPackResult {

  //给谁发
  private String key;
  //发多少
  private Object value;

  @Override
  protected boolean doPackResult(RulePack pack) {
    RuleRoam roam = pack.getRoam();
    Integer uid = roam.getValue(key);
    if (uid == null) {
      return false;
    }
    roam.put("result." + "sendAmount", this.value);
    roam.put("result." + "scene", pack.getScene());
    return true;
  }
}
